package java111;

import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Day23 {
    //https://ac.nowcoder.com/acm/problem/202487
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- > 0){
            int h = in.nextInt();
            int a = in.nextInt();
            int H = in.nextInt();
            int A = in.nextInt();
            int n, count = 0;
            if(H % a == 0){
                n = H / a - 1;
            } else {
                n = H / a;
            }
            boolean flag = false;
            if(n <= 0){
                System.out.println(-1);
                flag = true;
            }
            if(!flag){
                if(h % (n * A) == 0){
                    count = h / (n * A) - 1;
                } else {
                    count = h / (n * A);
                }
                System.out.println(count);
            }
        }
    }

    //https://www.nowcoder.com/questionTerminal/9fbb4d95e6164cd9ab52e859fbe8f4ec
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        TreeSet<String> set = new TreeSet<>();
        String[] arr = new String[n];
        for(int i = 0; i < n; i++){
            arr[i] = in.next();
            char[] chars = arr[i].toCharArray();
            Arrays.sort(chars);
            set.add(new String(chars));
        }

        System.out.println(set.size());
    }
}
